package com.hkd.product_service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hkd.common.api.ApiResponse;
import com.hkd.product_service.api.ProductSpecsService;
import com.hkd.product_service.api.entity.ProductSpecs;
import com.hkd.product_service.mapper.ProductSpecsMapper;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author HKD
 * @date 2022/9/17 23:10
 */
@RestController
public class ProductSpecsServiceImpl extends ServiceImpl<ProductSpecsMapper, ProductSpecs> implements ProductSpecsService {
    @Override
    @Transactional(rollbackFor = Exception.class)
    public ApiResponse<Integer> specsSaveBatch(List<ProductSpecs> specs) {
        this.saveBatch(specs);
        return ApiResponse.ok();
    }
}
